using System;
using System.Collections.Generic;
using System.Text;
using Zsa.Emulation.Input;
using System.Windows.Forms;

namespace Zsa.Emulation.Render.Input.Win32
{
    public class KeyboardInputSettings : ControllerSettings
    {
        private int[] _NesInputKeys = new int[32];
        public KeyboardInputSettings(RenderDeviceItem deviceId)
            : base ( deviceId )
        {
        }

        public void SetKey(NesInputButton button, byte player, Keys key)
        {
            int _ButtonIndex = (((int)button) - 1) + (player * 8);
            _NesInputKeys[_ButtonIndex] = (int)key;
        }


        public override ControllerSettings Clone()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override bool IsValid()
        {
            throw new Exception("The method or operation is not implemented.");
        }
        public override bool Equals(ControllerSettings other)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override ControllerDeviceManager CreateDevice()
        {
            return new GlobalKeyboardInput(this);
        }

        public override ControllerDeviceCapabilities Capabilities
        {
            get
            {
                return new KeyboardInputCapabilities();
            }
        }

        public int[] NesInputKeys
        {
            get
            {
                return _NesInputKeys.Clone() as Int32[];
            }
        }
    }
}
